import { pubRequire } from '@utils/public'
const baseUrl = '/communities'
const baseUrlTwo = 'coupons/goods'
/* 新增商品 */
export function addGoods(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}

// 根据id查询商品详情
export function getGoodsDetail(id, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/info`,'', callbBack, errBack)
}
// 编辑商品
export function editGoods(id,obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callbBack, errBack)
}

// /coupons/goods?type=goods
export function getCoupons(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrlTwo}`,obj, callbBack, errBack)
}